import PrintOrder from '@/components/PrintOrder/Index.vue'
import Vue from 'vue'

export default {
    installed: false,
    install(vue) {
        if (this.installed) return

        this.installed = true

        const PrintOrderNode = vue.extend(PrintOrder)

        const instance = new PrintOrderNode({
            el: document.createElement('div')
        })

        document.body.appendChild(instance.$el)

        Object.defineProperties(Vue.prototype, {
            $print: {
                get() {
                    return instance
                }
            }
        })
    }
}
